/**
 * 
 */
package com.antilia.infomaresme.provider;

import org.apache.wicket.model.LoadableDetachableModel;

import com.antilia.infomaresme.data.dao.interfaces.IItemsDao;
import com.antilia.infomaresme.data.dataobjects.Item;
import com.google.appengine.api.datastore.Key;

/**
 * @author Ernesto
 *
 */
public abstract class ItemsLdm extends LoadableDetachableModel<Item> {

	private static final long serialVersionUID = 1L;
	
	private Key id;

	
	/**
	 * @param object
	 */
	public ItemsLdm(Item object) {
		super(object);
		this.id = object.getId();
	}

	/* (non-Javadoc)
	 * @see org.apache.wicket.model.LoadableDetachableModel#load()
	 */
	@Override
	protected Item load() {
		return getItemsDao().load(id);
	}

	abstract IItemsDao getItemsDao();
}
